﻿@model RTW.Models.TBaseData
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="renderer" content="blink" />
    <title>基础数据编辑</title>
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet" />
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />
    <link href="/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
    <link href="/css/animate.min.css" rel="stylesheet" />
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet" />
    <link href="/css/style.min.css?v=4.1.0" rel="stylesheet" />
    <style type="text/css">
        .input-group-addon {
            width: 80px;
        }

        .input-group {
            margin-bottom: 15px;
            text-align: center;
            width: 100%;
        }

        .text-left label {
            font-weight: normal;
            margin-right: 8px;
            margin-left: 2px;
        }

        .checkbox label, .radio label {
            padding-left: 0px;
        }
    </style>
</head>
<body>
    <form id="form1" asp-action="BaseDataEdit">
        <div id="dContent">
            <div class="input-group">
                <span class="input-group-addon">名称</span>
                @*<asp:TextBox ID="txtBDName" runat="server" CssClass="form-control" dataType="null" Msg="名称不能为空!"></asp:TextBox>*@
                @Html.TextBoxFor(m=>m.BDName,new { @Class = "form-control" ,dataType = "null", Msg = "名称不能为空!" })
            </div>
            <div class="input-group">
                <span class="input-group-addon">代码</span>
                @*<asp:TextBox ID="txtPinYinNo" runat="server" CssClass="form-control"></asp:TextBox>*@
                @Html.TextBoxFor(m=>m.PinYinNo,new {@Class = "form-control"})
            </div>
            <div class="input-group">
                <span class="input-group-addon">其他码</span>
                @*<asp:TextBox ID="txtOtherNo" runat="server" CssClass="form-control"></asp:TextBox>*@
                @Html.TextBoxFor(m=>m.OtherNo,new { @Class = "form-control" })
                @*<asp:DropDownList ID="ddlOtherNo" runat="server" CssClass="form-control">
                    <asp:ListItem Value="诉讼" Text="诉讼档案"></asp:ListItem>
                    <asp:ListItem Value="文书" Text="文书档案"></asp:ListItem>
                    <asp:ListItem Value="基建" Text="基建档案"></asp:ListItem>
                    <asp:ListItem Value="工程" Text="工程档案"></asp:ListItem>
                    <asp:ListItem Value="设备" Text="设备档案"></asp:ListItem>
                    <asp:ListItem Value="音频" Text="音频档案"></asp:ListItem>
                    <asp:ListItem Value="声像" Text="声像档案"></asp:ListItem>
                    <asp:ListItem Value="照片" Text="照片档案"></asp:ListItem>
                    <asp:ListItem Value="光盘" Text="光盘档案"></asp:ListItem>
                    <asp:ListItem Value="电子" Text="电子档案"></asp:ListItem>
                    <asp:ListItem Value="技术" Text="技术档案"></asp:ListItem>
                    <asp:ListItem Value="会计" Text="会计档案"></asp:ListItem>
                    <asp:ListItem Value="实物" Text="实物档案"></asp:ListItem>
                    <asp:ListItem Value="其他" Text="其他"></asp:ListItem>
                </asp:DropDownList>*@
            </div>
            <div class="input-group">
                <span class="input-group-addon">检索码</span>
                @*<asp:TextBox ID="txtSearchNo" runat="server" CssClass="form-control"></asp:TextBox>*@
                @Html.TextBoxFor(m=>m.Bak1,new { @Class = "form-control" })
            </div>
            <div class="input-group">
                <span class="input-group-addon">备注</span>
                <asp:TextBox ID="txtRemark" runat="server" CssClass="form-control" TextMode="MultiLine" Height="65"></asp:TextBox>
                @Html.TextBoxFor(m => m.Remark, new { @Class = "form-control", TextMode = "MultiLine" ,Height = "65" })
            </div>
            <div class="input-group">
                <span class="input-group-addon">状态</span>
                <div class="form-control text-left">
                    <div class="checkbox i-checks" style="float: left; margin-right: 5px; width: 150px; text-align: left; margin-top: 5px;">
                        @Html.CheckBoxFor(m => m.StateValue)
                        <label style="padding-left: 0px;">
                            @*<asp:CheckBox ID="cboxState" runat="server" Text="停用" />*@
                            停用
                        </label>
                    </div>
                </div>
            </div>
            <div class="input-group">
                <span class="input-group-addon">索引</span>
                @*<asp:TextBox ID="txtIndex" runat="server" CssClass="form-control" dataType="null,zzs" Msg="索引格式不正确!"></asp:TextBox>*@
                @Html.TextBoxFor(m => m.Flag1, new { @Class = "form-control" ,dataType = "null,zzs" ,Msg = "索引格式不正确!" })
            </div>
        </div>
        <div class="zui-footer">
            @*<asp:Button ID="btnSave" runat="server" CssClass="btn btn-primary btn-sm" Text="保存" OnClick="btnSave_Click" OnClientClick="return verfic('tip', '#dContent');" />*@
            <button id="btnSave" class="btn btn-primary btn-sm" type="submit">保存</button>
            <button class="btn btn-default btn-sm" type="button" onclick="closePage()">关闭</button>
        </div>

        <script src="/js/jquery.min.js?v=2.1.4"></script>
        <script src="/js/bootstrap.min.js?v=3.3.6"></script>
        <script src="/js/plugins/jeditable/jquery.jeditable.js"></script>
        <script src="/js/plugins/dataTables/jquery.dataTables.js"></script>
        <script src="/js/plugins/dataTables/dataTables.bootstrap.js"></script>

        <script src="/js/My97DatePicker/WdatePicker.js"></script>
        <script src="/js/plugins/layer/layer.min.js"></script>
        <script src="/js/plugins/iCheck/icheck.min.js"></script>
        <script src="/js/verification.js"></script>
        <script src="/js/zuiCode.js"></script>
        <script type="text/javascript">

                //提交
                (function ($) {
                    $.basedata = {
                        init: function () {
                            $(".i-checks").iCheck({
                                checkboxClass: "icheckbox_square-green",
                                radioClass: "iradio_square-green"
                            })
                        },
                        formSubmit: function () {
                            $("#form1").validate({
                                rules: {
                                    BDName: {
                                        required: true
                                    },
                                    Bak1: {
                                        required: true
                                    },
                                    Flag1: {
                                        required: true
                                    }
                                },
                                errorPlacement: function (error, element) {
                                    //错误消息不为空，提示Msg消息或默认消息
                                    if (error[0].textContent != "") {
                                        if (error[0].textContent != undefined) {
                                            let msg = element.attr("Msg") ? element.attr("Msg") : error.textContent;
                                            showTip(msg, 2);
                                        }
                                    }
                                },
                                onkeyup: false,
                                focusCleanup: true,
                                success: "valid",

                                submitHandler: function (form) {
                                    //return verfic('tip', '#dContent');
                                    //var fRankName = $("select[name='fRankId']").find("option:selected").text();
                                    //var fState = $("input[name='fState']").is(':checked');
                                    $(form).ajaxSubmit({
                                        type: "POST",
                                        cache: false,
                                        //data: { fRankName: fRankName, fState: fState },
                                        dataType: "json",
                                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                                            if (XMLHttpRequest.status != 200) {
                                                showTip(errorThrown, 2);
                                            }
                                        },
                                        success: function (result) {

                                            var state = result.success;
                                            var message = result.msg;
                                            if (state) {
                                                showTip(message, 1, 2);
                                            } else {
                                                showTip(message, 2);
                                            }

                                        }
                                    });
                                }
                            });
                        }
                    };
                    $(function () {
                        $.basedata.init();
                        $.basedata.formSubmit();
                    });
                })(jQuery);
        </script>
    </form>
</body>
</html>
